import request from '@/utils/request'

/**
 * 获取文章分类
 */

export const getArticleCateApi = (data) => {
  return request({
    method: 'get',
    url: '/ydd_cate/list',
    params: data
  })
}

/**
 * 添加分类
 */
export const addArticleCateApi = (data) => {
  return request({
    method: 'post',
    url: '/ydd_cate/add',
    data
  })
}

/**
 * 删除分类
 */
export const delArticleCateApi = (id) => {
  return request({
    method: 'get',
    url: `/ydd_cate/del?id=${id}`
  })
}

/**
 * 修改分类
 */

export const editArticleCateApi = (data) => {
  return request({
    method: 'post',
    url: '/ydd_cate/update',
    data
  })
}

/**
 * 分类详情
 */
export const getArticleDetailApi = (id) => {
  return request({
    method: 'get',
    url: `/ydd_cate/rowInfo?id=${id}`
  })
}

/**
 * 获取全部分类
 */
export const getArticleCateAllApi = () => {
  return request({
    method: 'get',
    url: '/ydd_cate/all'
  })
}
